import com.wtf.config.RpcClient;
import org.rpc.service.IUserService;

/**
 * desc:
 *
 * @author tengfei wang
 * @version 1.0
 * @date Created in 11/10/2020
 */
public class ClientBootstrap {

    public static void main(String[] args) throws InterruptedException {

        RpcClient rpcClient = new RpcClient("127.0.0.1", 9999);
        //创建代理对象
        IUserService userService = (IUserService) rpcClient.createProxy(IUserService.class);

        while (true) {
            String result = userService.sayHello("hello my rpc");
            System.out.println("response is: " + result);

            Thread.sleep(2000);
        }
    }
}
